Requirement: An empty visualization object is inserted into the project and it is open for editing in the visualization editor. There is also a “Visualization Manager” object. User management is not created for the visualization.
The following instructions provide a simplified example:
-
By means of two buttons, the user should be able to toggle the visualization texts between English and German.
-
Static texts in the visualization include the labels "State, Machine 01", "State, Machine 02", "English", and "German". These texts are located in the “GlobalTextList” in English and German.
Dynamic texts will describe the state of both machines. The texts are provided in the text list “Status_Texts” in English (
en
) and German (de
).
-
Drag a “Text Field” from the “Visualization Toolbox” view (“Common Controls” category) to the editor view. Specify the value
State, Machine M01
in the properties editor for the “Texts Text” element property. -
Copy the element and change the copy label to
State, Machine M02
. -
See also the figure in step 14 for the following steps.
Insert two elements of type “Button” from the “Visualization Toolbox” view (“Common Controls” category) in the visualization editor. With these elements, the user should be able to toggle the language of the visualization. Specify the text
German
orEnglish
in the properties editor for “Texts Text” (4) element property. -
Double-click and open “GlobalTextList” in the “POUs” view.
The texts are entered in the “Standard” (1) column, and the “ID”s
0
and1
are assigned automatically as additional information. -
Add the languages “de” and “en” with the texts shown in the following figure.
→
-
Close the “GlobalTextList”.
-
Add two elements of type “Rectangle” from the “Visualization Toolbox” view (“Basic” category) in the visualization editor. The current state of each machine should be displayed.
-
For managing the texts for describing the states, add an object of type “Text List” below the application. Name the list
Status_Texts
. -
Specify the texts shown in the figure for the standard language (1) and the target languages “en” and “de” in the editor of “Status_Texts”.
→
-
Close the text list “Status_Texts”.
-
Select the rectangle element for displaying the state of machine M01. Select the text list
Status_Texts
from the combo box in the properties editor (2) for the “Dynamic texts” element property (5). Specify an application variable for “Text index” that shows the appropriate text index for the state of the machine at runtime. Example:PLC_PRG.ivar_status_m01
. -
Now configure the user input for both buttons for toggling the language in the visualization.
Select the "German" button. Double-click “Configure” of the property “Input configuration” (6), “OnMouseClick”.
The “Input configuration / OnMouseClick” dialog opens.
-
Select “Change the language” on the left. Click the arrows to accept the setting to the right. Select “de” in “Language” to the right of the dialog in the
Input Assistant. Click “OK” to confirm.
-
In the same way, configure the entry for the second button:
English
: “Text list”:Status_Texts
, “Text index”:3
, “Change the language”: English).The following figure shows the performed properties configurations for the four visualization elements.
-
When the application is compiled without errors, you can test the visualization in simulation mode. Select the “Online Simulation” option. Click “Online Login”.
The visualization appears in the visualization editor view in online mode:
-
Click the “German” button.
The language changes to German: